import type { App } from 'vue';
import pinia from '@/store';
import useUserStore from '@/store/modules/user';

let userStore = useUserStore(pinia);
export const isHasButton = (app: App) => {
  app.directive('has', {
    mounted(el: any, binding: any) {
      if (!userStore.buttons.includes(binding.value)) {
        el.parentNode.removeChild(el);
      }
    },
  });
};
